package com.secf.service.port.hpy.hys.test.day3;

/**
 * @Author ms
 * @Date 2024-08-08
 */
public class ImageProcessing {
    public static void main(String[] args) {
        // 初始化一个3x3的灰度图像
        int[][] image = {
                {100, 120, 130},
                {140, 150, 160},
                {170, 180, 190}
        };

        // 对每个像素进行处理（例如增加亮度）
        int brightnessIncrease = 20;
        for (int i = 0; i < image.length; i++) {
            for (int j = 0; j < image[i].length; j++) {
                image[i][j] += brightnessIncrease;
                // 确保像素值在0-255范围内
                if (image[i][j] > 255) {
                    image[i][j] = 255;
                }
            }
        }

        // 输出处理后的图像
        for (int[] row : image) {
            for (int pixel : row) {
                System.out.print(pixel + " ");
            }
            System.out.println();
        }
    }
}
